<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %>

	<!-- This code written by : Willie Wheeler and John Wheeler -->
	<!-- For 'Spring In Practice' [Book written by Willie Wheeler and John Wheeler] -->

<c:url var="homeUrl" value="/spring/forums/home.do"/>
<c:url var="loginUrl" value="/spring_security_login"/>
<c:url var="adminUrl" value="/spring/forums/admin.do"/>
<c:url var="accountUrl" value="/spring/forums/account.do"/>
<c:url var="logoutUrl" value="/j_spring_security_logout"/>

<div id="header">
	<div style="float:right">
		<security:authorize ifAnyGranted="ROLE_ANONYMOUS">
			Welcome guest
		</security:authorize>
		<security:authorize ifNotGranted="ROLE_ANONYMOUS">
			Welcome <security:authentication property="name"/>
			<security:authorize ifAnyGranted="ROLE_JUNIOR_MEMBER">
				[Junior Member]
			</security:authorize>
			<security:authorize ifAnyGranted="ROLE_MEMBER">
				[Member]
			</security:authorize>
			<security:authorize ifAnyGranted="ROLE_SENIOR_MEMBER">
				[Senior Member]
			</security:authorize>
			<security:authorize ifAnyGranted="ROLE_ADMIN">
				[Admin]
			</security:authorize>
		</security:authorize>
	</div>
	<div>
		<a href="${homeUrl}">Home</a>
		<security:authorize ifAnyGranted="ROLE_ADMIN">
			| <a href="${adminUrl}">Admin</a>
		</security:authorize>
		<security:authorize ifAnyGranted="ROLE_ANONYMOUS">
			| <a href="${loginUrl}">Login</a>
		</security:authorize>
		<security:authorize ifNotGranted="ROLE_ANONYMOUS">
			| <a href="${accountUrl}">Account</a>
			| <a href="${logoutUrl}">Logout</a>
		</security:authorize>
	</div>
	<div style="clear:both"></div>
</div>
